# -*- coding: utf-8 -*-

from django.contrib.auth.models import User
from django.db import models
from longerusernameandemail import MAX_USERNAME_LENGTH

BDAY_LIMIT = 120

class AccountActivation(models.Model):
    key = models.CharField(max_length=30)
    code = models.CharField(max_length=16)
    activated = False
    username = models.CharField(max_length=MAX_USERNAME_LENGTH())
    
class UserProfile(models.Model):
    
    @staticmethod
    def signupFields():
        return ('name', 'gender', 'nationality', 'bday', 'pid', 'phoneNum', 'emgcyContact', 'emgcyContPhone')
    
    user = models.OneToOneField(User)
    
    modified = models.IntegerField(blank=True, default=0)
    
    # general fields
    name = models.CharField(max_length=100)
    gender = models.CharField(max_length=6)
    nationality = models.CharField(max_length=100, blank=True, null=True)

    bday = models.DateField(blank=True, null=True)
    pid = models.CharField(max_length=100, blank=True, null=True) # personal id
    phoneNum = models.CharField(max_length=50, blank=True, null=True)
    emgcyContact = models.CharField(max_length=200, blank=True, null=True)
    emgcyContPhone = models.CharField(max_length=50, blank=True, null=True)
    
    